package com.frejoys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.dao.entity.UserQrcode;

public interface UserQrcodeService extends IService<UserQrcode> {

    default UserQrcode getOnly(QueryWrapper<UserQrcode> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default UserQrcode getOnly(LambdaQueryWrapper<UserQrcode> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    // 获取用户码
    UserQrcode getCodeInfo(Long userId);

    // 更新二维码
    boolean upQrCode(Long userId, String qrCode);


}
